import * as THREE from 'three';
import mitt from 'mitt'
export function loadRoam(app) {
    createVideo(app)
}
function createVideo(app) {
    let video = document.createElement('video');
    video.src = "/textures/texture/yanhua.mp4";
    video.autoplay = true;//自动播放
    video.loop = true;//循环播放
    video.muted = true;//静音
    video.playsinline = true//网页内部播放而不是全屏播放
    setTimeout(() => {
        video.play()
    }, 0)
    app.model.traverse((obj) => {
        if (obj.name == '中间展览位屏幕001') {
            const texture = new THREE.VideoTexture(video);
            const basicMaterial = new THREE.MeshBasicMaterial({
                map: texture
            })
            texture.flipY = false
            texture.wrapS = THREE.RepeatWrapping;
            texture.wrapT = THREE.RepeatWrapping;
            texture.repeat.set(4, 3);
            texture.rotation = Math.PI / 2
            obj.material = basicMaterial;
        }
    })
}

